<template>
	<view class="container">
		<my-search @open="open"></my-search>

		<uni-popup type="bottom" ref="popup" background-color="#fff" mask-click="true">
			<view class="bottom-popup">
				<my-popup :popupList="searchList" @close="close" :wh="wh"></my-popup>
			</view>
		</uni-popup>
		<view class="hisoty">
			<view class="search-hisoty" v-for="(n,i) in searchHisoty" :key="i">
				{{n}}
			</view>
		</view>
		<view class="company">
				<CompanyList :list='companyList' @click='toCamponyDetail'/>
		</view>
	</view>
</template>

<script>
	import CompanyList from '@/components/company-list/company-list.vue'
	export default {
		components:{
			CompanyList
		},
		data() {
			return {
				wh: 0,
				searchList: [{
						id: 1,
						name: '区县',
						data: ['市辖区', '芙蓉区', '天心区', '岳麓区', '开福区', '雨花区', '长沙县', '望城县']
					},
					{
						id: 2,
						name: '职业类型',
						data: ['全部职业', '月嫂', '育婴师', '保洁/清洁阿姨', '保姆', '产康师', '早教', '养老']
					},
					{
						id: 3,
						name: '信誉等级',
						data: ['AAAA', 'AAAAA']
					},
					{
						id: 4,
						name: '已认证客户服务数量',
						data: ['大于100人', '50-100', '30-50', '少于30人']
					},
					{
						id: 5,
						name: '职业类型',
						data: ['500-1000人', '1000以内', '200以内', '200-500']
					}
				],
				companyList:[
					{
						id:1,
						name:'湖南金管家家政服务有限公司',
						text:'您的笑容（满意），我们的追求',
						status:['协会成员','服务号','环境优美'],
						distance:'20.5km',
						address:'湖南省长沙市天心去暮云工业园开服曼程住宅长沙市天心去暮云工业园开服曼程住宅',
						image:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimages.3158.cn%2Fdata%2Fattachment%2Ftougao%2Farticle%2F2018%2F05%2F25%2F0e2804ac21b4519ea6880d09acc16811.jpg&refer=http%3A%2F%2Fimages.3158.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668394924&t=e33d929f557b297c1b1bfa7208755688'
					},
					{
						id:1,
						name:'湖南金管家家政服务有限公司',
						text:'您的笑容（满意），我们的追求',
						status:['协会成员','服务号','环境优美'],
						distance:'20.5km',
						address:'湖南省长沙市天心去暮云工业园开服曼程住宅',
						image:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fweb.51ejz-yspx.com%2Fuploads%2Fallimg%2F180917%2F1-1P91G540210-L.gif&refer=http%3A%2F%2Fweb.51ejz-yspx.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668394956&t=c590a4f81b8307a3073b5dfb1443cc64'
					},
					{
						id:1,
						name:'湖南金管家家政服务有限公司',
						text:'您的笑容（满意），我们的追求',
						status:['协会成员','服务号','环境优美'],
						distance:'20.5km',
						address:'湖南省长沙市天心去暮云工业园开服曼程住宅',
						image:'https://img2.baidu.com/it/u=1607360708,926391550&fm=253&fmt=auto&app=138&f=PNG?w=504&h=371'
					}
				],
				
				searchHisoty: ['月嫂', '保姆', '产康师', '育婴师', '家装/搬家', '早教/托育', '养老/陪护', '保洁/清洗', '全部职业']
			
			}
		},
		onLoad() {
			const sysInfo = uni.getSystemInfoSync()
			this.wh = sysInfo.windowHeight - 42
		},
		methods: {
			open() {
				// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ，type 属性将失效 ，仅支持 ['top','left','bottom','right','center']
				this.$refs.popup.open('buttom')
			},
			close() {
				this.$refs.popup.close()
			},
			toCamponyDetail(item){
				wx.navigateTo({
					url:'/subpkg/domestic-company/domestic-company?company='
				})
			}
		}
	}
</script>

<style lang="scss">
	.container {
		background-color: #f9f5f5;
		.company:before{
				content:''
			}
		.company{
			background-color: #FFFFFF;
		}
		.hisoty {
			display: flex;
			align-content: flex-start;
			flex-flow: row wrap;
			background-color: #FFFFFF;
			margin-bottom: 10px;
			.search-hisoty {
				box-sizing: border-box;
				border: 1px solid #aaaaaa;
				padding: 0 15px;
				border-radius: 10px;
				
				font-size: 12px;
				margin: 10px;
				margin-bottom: 5px;
				height: 22px;
			}
		}
	}
	.container .company .company-list{
		padding: 0;
	}
</style>
